/*
 * @Author: 杨小灿jian308@qq.com
 * @Date: 2023-05-18 15:41:02
 * @LastEditors: 杨小灿jian308@qq.com
 * @LastEditTime: 2023-05-18 16:00:40
 */
package utils

import "unsafe"

// bytes string互转
func BytesToString(b []byte) string {
	//return unsafe.String(&b[0], len(b))
	return unsafe.String(unsafe.SliceData(b), len(b))
}

func StringToBytes(s string) []byte {
	return unsafe.Slice(unsafe.StringData(s), len(s))
}
